import request2, { downloadPost } from '@/utils/request2'
import { materialApiUrl } from '../../config'


export default {
  // 现场消耗物资明细-统计
  count(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/count', method: 'post', params, data
    })
  },
  // 现场消耗物资明细-明细批量新增
  createByDetails(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/createByDetails', method: 'post', params, data
    })
  },
  createByMain(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/createByMain', method: 'post', params, data
    })
  },
  // 现场消耗物资明细-明细行删除
  deleteByDetails(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/deleteByDetails', method: 'post', params, data
    })
  },
  // 物资效益分析-标准模板下载
  downMaterialSceneConsumeExcel(data, fileName) {
    return downloadPost(materialApiUrl + '/materials/scene_consume/downMaterialSceneConsumeExcel', data, null, fileName)

  },
  // 现场消耗物资-删除
  deleteByMain(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/deleteByMain', method: 'post', data, params
    })
  },
  // 现场消耗物资明细-明细编辑行
  editByDetails(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/editByDetails', method: 'post', data, params
    })
  },
  // /现场消耗物资明细-编辑
  editByMain(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/editByMain', method: 'post', params, data
    })
  },
// 现场消耗物资明细-id查询详情
  findById(params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/findById/' + params.id, method: 'get', params
    })
  },
  // /现场消耗物资明细-列表搜索
  findListByMain(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/findListByMain', method: 'post', params, data
    })
  },
  findListByDetails(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/findListByDetails', method: 'post', params, data
    })
  },
  // 现场消耗物资明细-打印
  print(data, params) {
    return request2({
      url: materialApiUrl + '/materials/scene_consume/print/' + params.id, method: 'get', params, data
    })
  }
}